const path = require('path');
const htmlWebpackPlugin = require('html-webpack-plugin');
const VueLoaderPlugin = require('vue-loader/lib/plugin')

var config = {
	entry:'./src/main.js',
	output:{
		path:path.resolve(__dirname,'dist'),
		filename:'bundle.js'
	},
	module:{
		rules:[
			{ test:/\.css$/,use:['style-loader','css-loader']},
			{ test:/\.less$/,use:['style-loader','css-loader','less-loader']},
			{ test:/\.scss/,use:['style-loader','css-loader','sass-loader']},
			{ test:/\.(png|svg|jpg|gif|jpeg|bmp)$/,use:'url-loader'},
			{ test:/\.(ttf|eof|svg|woff|wpff2)$/,use:'url-loader'},
			{ test:/\.js$/,exclude:/node_modules/,use:'babel-loader'},
			{ test:/\.vue$/,use:'vue-loader'}
			
		]
	},
	plugins:[
		new htmlWebpackPlugin({
			template:path.join(__dirname,'./src/index.html'),
			filename:'index.html'
		}),
		new VueLoaderPlugin()
	],
	resolve:{
		alias:{
			"vue$":"vue/dist/vue.js"
		}
	},
	mode:'development'
};

module.exports = config;